package class51To60;

import java.io.*;
import java.util.Arrays;

public class topologicalSort {

    public static int MAX_N = 200005;

    public static int MAX_M = 200005;

    public static int n, m, u, v;

    public static int[] queue = new int[MAX_N];

    public static int[] ans = new int[MAX_N];

    public static int l, r;

    public static int[] head = new int[MAX_N];

    public static int[] next = new int[MAX_M];

    public static int[] to = new int[MAX_M];

    public static int cnt;

    public static int[] indegree = new int[MAX_N];

    public static void build(int n) {
        cnt = 1;
        Arrays.fill(indegree, 0, n + 1, 0);
        Arrays.fill(head, 0, n + 1, 0);
    }

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StreamTokenizer in = new StreamTokenizer(br);
        PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
        while (in.nextToken() != StreamTokenizer.TT_EOF) {
            n = (int) in.nval;
            in.nextToken();
            m = (int) in.nval;
            build(n);
            for (int i = 0; i < m; i++) {
                in.nextToken();
                u = (int) in.nval;
                in.nextToken();
                v = (int) in.nval;
                addEdge(u, v);
                indegree[v]++;
            }
            if (!solve()) {
                out.println(-1);
            } else {
                for (int i = 0; i < n - 1; i++) {
                    out.print(ans[i] + " ");
                }
                out.println(ans[n - 1]);
            }
        }
        out.flush();
        out.close();
        br.close();
    }

    private static void addEdge(int u, int v) {
        next[cnt] = head[u];
        to[cnt] = v;
        head[u] = cnt++;
    }

    private static boolean solve() {
        l = 0;
        r = 0;
        for (int i = 1; i <= n; i++) {
            if (indegree[i] == 0) {
                queue[r++] = i;
            }
        }
        int cnt = 0;
        while (l < r) {
            int cur = queue[l++];
            ans[cnt++] = cur;
            for (int ei = head[cur]; ei > 0; ei = next[ei]) {
                if (--indegree[to[ei]] == 0) {
                    queue[r++] = to[ei];
                }
            }
        }
        return cnt == n;
    }

}
